package cn.akwangl.design.pattern.behavioral.state.v1;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 状态模式v1.
 *
 * @author youyongkun
 * @date 2021/12/6 10:20
 */
public class Work {

    private LocalDateTime time = LocalDateTime.now();

    private State state;

    public Work(State state) {
        this.state = state;
    }

    public void writeCode(){
        state.handle(this);
    }

    public LocalDateTime getTime() {
        return time;
    }

    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
    }
}
